<template>
  <div>
    <van-field readonly label="名称" type="text" :value="form.OccupationalDiseasesName"></van-field>
    <van-field readonly label="位置" type="text" :value="form.OccupationalDiseasesPosition"></van-field>
    <van-field readonly label="最近检测时间" type="text" :value="form.LatelyCheckDate|formatDate "></van-field>
    <van-field readonly label="检测频次" type="text" :value="form.InspectFrequency"></van-field>
     <FileUpload readonly autoSize @CallBack="_fileUploadCb" :attachs="form.Attachs" :allowEdit="false" :labelName="'相关附件'" />
  </div>
</template>
<script>
import { nsOccupationalDiseasesRecordDetail } from "@/api/ns";
export default {
  data() {
    return {
      id: this.$route.query.id,
      autoSize: { minRow: 1 },
      form: {}
    };
  },
  created() {
    this.getDetail();
  },
  methods: {
    _fileUploadCb(attachs) {
      this.form.Attachs = attachs;
    },
    getDetail() {
      var me = this;
      let params = { id: this.id };
      nsOccupationalDiseasesRecordDetail(params).then(res => {
        me.form = res.data;
        me.form.TypeList = me.form.Type == null ? [] : me.form.Type.split(",");
      });
    }
  }
};
</script>